<?php
	require '../config.php';
	session_start(); 
	if(isset($_POST['submit'])){
		$username = isset($_POST['username'])?trim($_POST['username']):'';
		$password = isset($_POST['password'])?trim($_POST['password']):'';
		$verify = isset($_POST['verify'])?trim($_POST['verify']):'';
 
		if($username !='lzChineseAdmin' || $password !='lz_GHjf' ){
			func::showMsg('请确认帐号和密码！', 'login.php');
		}
		if($verify!=$_SESSION['verification_code'] || $verify == ''){
			func::showMsg('请确认检测码！', 'login.php');
		}
		unset($_SESSION['verification_code']);
		$_SESSION['userId'] = $username;
		header('location:index.php');
	}else if(isset($_GET['logoff'])){
		session_destroy();
	}
	require_once 'tpl/login.html';
?>